package org.lynn;

import org.apache.catalina.connector.Response;
import org.apache.tomcat.util.http.MimeHeaders;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;


/**
 * description:
 * Created by gy on 2017/12/12.
 */
@RestController
public class TestController {

    @RequestMapping(path = "/test")
    public void test(HttpServletResponse response){

        response.setHeader("Lynn","test");
        response.setHeader("Lynn","test2");

        response.addHeader("Lynn","test");
        response.addHeader("Lynn","test2");

        if(response instanceof  Response) {
            Response rep = (Response) response;
            MimeHeaders mimeHeaders = rep.getCoyoteResponse().getMimeHeaders();
            mimeHeaders.removeHeader("Lynn");
        }
        System.out.println("test");
    }

}
